//
//  ARWordCell.m
//  AriseSamePro
//
//  Created by 包日守 on 15/10/31.
//  Copyright © 2015年 Arise. All rights reserved.
//

#import "ARWordCell.h"


@interface ARWordCell ()

@property (weak, nonatomic) IBOutlet UIImageView *icomImageView;

@property (weak, nonatomic) IBOutlet UILabel *namelabel;

@property (weak, nonatomic) IBOutlet UILabel *dateLabel;


@property (weak, nonatomic) IBOutlet UILabel *contentLabel;

@property (weak, nonatomic) IBOutlet UILabel *likesLabel;
@property (weak, nonatomic) IBOutlet UILabel *viewsLabel;

@property (weak, nonatomic) IBOutlet UIButton *likeButton;


@end

@implementation ARWordCell

- (IBAction)shareButtonClick:(id)sender {
    
    if (self.ShareBtnBlock) {
        self.ShareBtnBlock(self.cateModel,sender);
    }
}



- (void) setCateModel:(ARCate5Model *)cateModel
{
    _cateModel = cateModel;
    
    self.icomImageView.clipsToBounds = YES;
    self.icomImageView.layer.cornerRadius = 16;
    
    
    self.icomImageView.image = nil;

    [self.icomImageView setImageWithURL:[NSURL URLWithString:cateModel.userModel.avatar]];

    
    self.namelabel.text = cateModel.userModel.username;
    self.contentLabel.text = cateModel.txt;
    self.likesLabel.text = cateModel.likes.stringValue;
    self.viewsLabel.text = cateModel.views.stringValue;

}

- (IBAction)likeButtonClick:(id)sender {
    [self likeButtonAction];
    
}


- (UIButton *) myLikeButton
{
    return self.likeButton;
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
